<div ng-controller="instanceCtrl">
    <div class="clearfix" style="padding:5px 0px ">
        <h5 class="pull-left">{{(curMenu.ptexts?curMenu.ptexts+'-->':'')+curMenu.text}}<span ng-if="search.curInstance">
            --><span class="btn-link" ng-click="search.curInstance=undefined" role="button">{{search.curInstance.name}}</span>
            </span>
        </h5>
    </div>

    <table class="table table-bordered table-striped table-hover" ng-show="!search.curInstance">
        <thead class="title">
            <tr>
                <th class="text-center">NO</th>
                <th>名称</th>
                <th>图标文件夹</th>
                <th>描述</th>
                <th>修改人</th>
                <th>修改时间</th>
                <th>创建人</th>
                <th>创建时间</th>
                <th style="width:120px">操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-if="pageModel.data.length == 0">
                <td colspan="100" class="text-center">暂无记录</td>
            </tr>
            <tr ng-repeat="item in pageModel.data">
                <td class="text-center">{{$index + 1+pageModel.pageSize*pageModel.pageIndex}}</td>
                <td><span class="btn-link" role="button" ng-click="showDetail(item)">{{item.name}}</span></td>
                <td>{{item.folderId|keyToValue:folderList:'id':'text'}}</td>
                <td>{{item.comment}}</td>
                <td>{{item.modifierName}}</td>
                <td>{{item.modifyTime| date:'yyyy-MM-dd HH:mm:ss':'UTC+8'}}</td>
                <td>{{item.creatorName}}</td>
                <td>{{item.createTime| date:'yyyy-MM-dd HH:mm:ss':'UTC+8'}}</td>
                <td>
                    <a href='javascript:void(0)' ng-if="$root.hasPower('复制样式')" ng-click='showEditModal(item,true)' class='btn btn-xs btn-link'><span class='fa fa-copy'></span>复制</a>
                    <a href='javascript:void(0)' ng-if="$root.hasPower('style',item.id)" ng-click='showEditModal(item)' class='btn btn-xs btn-link'><span class='fa fa-edit'></span>编辑</a>
                    <a href='javascript:void(0)' ng-if="$root.hasPower('style',item.id)" ng-click='del(item)' class='btn btn-xs btn-link'><span class='fa fa-trash'></span>删除</a>
                    <a href='javascript:void(0)' ng-click='downloadXml(item)' class='btn btn-xs btn-link'><span class='fa fa-file'></span>xml</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="page-footer clearfix" ng-show="!search.curInstance">
        <page page-model="pageModel"></page>
    </div>
    <div ng-repeat="item in instanceCache">
        <instance-detail cur-instance="item" search="search" ng-show="item == search.curInstance"></instance-detail>
    </div>

    <div class="panel panel-info dictDetail " style="margin-bottom: 0" ng-if="search.curDict">
        <div class="panel-heading text-center">
            <div color-trans color-id="search.curDict.id" instance='search.curInstance' element-id="search.curDict.type"></div>
            <img src="images/refuse.png" role="button" style="top:5px;right:5px;position:absolute;z-index: 1" ng-click="search.curDict = null"></img>
        </div>
        <div class="panel-body" style="padding:0">
            <table class="table table-bordered table-striped table-hover" style="margin-bottom: 0;background:white">
                <thead class="title">
                    <tr>
                        <th class="text-center">NO</th>
                        <th><span uib-tooltip="Style">样式</span></th>
                        <th><span uib-tooltip="AliasName">分类名称</span></th>
                        <th><span uib-tooltip="scale">级别</span></th>
                        <th ng-if="search.curDict.type == 'font'"><span uib-tooltip="font-name">字体名称</span></th>
                        <th ng-if="search.curDict.type == 'fontSize'"><span uib-tooltip="font-name">字体大小</span></th>

                        <th ng-if="['point','line','roadSign'].indexOf(search.curDict.type)>-1"><span uib-tooltip="font-color">字体前景色</span></th>
                        <th ng-if="['point','line','roadSign'].indexOf(search.curDict.type)>-1"><span uib-tooltip="halocolor">光晕</span></th>

                        <th ng-if="search.curDict.type == 'dashLine'"><span uib-tooltip="dash-line-name">点划线样式</span></th>
                        <th ng-if="search.curDict.type == 'line'"><span uib-tooltip="stroke">画线颜色</span></th>
                        <th ng-if="search.curDict.type == 'line'"><span uib-tooltip="stroke-side">描边颜色</span></th>
                        <th ng-if="search.curDict.type == 'polygon'"><span uib-tooltip="fill">填充颜色</span></th>
                        <th ng-if="search.curDict.type == 'polygon'"><span uib-tooltip="border-color">描边颜色</span></th>

                        <th ng-if="search.curDict.type == 'building'"><span uib-tooltip="roof-color">楼顶颜色</span></th>
                        <th ng-if="search.curDict.type == 'building'"><span uib-tooltip="root-color">地面颜色</span></th>
                        <th ng-if="search.curDict.type == 'building'"><span uib-tooltip="wall-color">侧面颜色</span></th>
                        <th ng-if="search.curDict.type == 'building'"><span uib-tooltip="window-color">窗户颜色</span></th>
                        <th ng-if="search.curDict.type == 'building'"><span uib-tooltip="roof-line-color">楼顶边颜色</span></th>
                        <th ng-if="search.curDict.type == 'building'"><span uib-tooltip="wall-line-color">侧面边颜色</span></th>
                        <th ng-if="search.curDict.type == 'building'"><span uib-tooltip="roof-line-color-2d">2D模式楼顶边颜色</span></th>
                        <th ng-if="search.curDict.type == 'building'"><span uib-tooltip="roof-color-2d">2D模式楼顶颜色</span></th>

                        <th ng-if="search.curDict.type == 'arrow'"><span uib-tooltip="color">颜色</span></th>


                        <th style="width:120px">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-if="!search.curDict.pageModel.data || search.curDict.pageModel.data.length == 0">
                        <td colspan="100" class="text-center">暂无记录</td>
                    </tr>
                    <tr ng-repeat="item in search.curDict.pageModel.data">
                        <td class="text-center">{{$index + 1}}</td>
                        <td class="text-center">{{item.style.element|keyToValue:elementEnum:'id':'name'}}</td>
                        <td class="text-center">{{(item.style.text||item.style.name)+"_"+item.style.code}}</td>
                        <td>{{item.scale}}</td>
                        <td ng-if="search.curDict.type == 'font'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.fontName"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'fontSize'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.fontSize"></i>
                        </td>
                        <td ng-if="['point','line','roadSign'].indexOf(search.curDict.type)>-1" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.fontColor"></i>
                        </td>
                        <td ng-if="['point','line','roadSign'].indexOf(search.curDict.type)>-1" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.halocolor"></i>
                        </td>
                         <td ng-if="search.curDict.type == 'dashLine'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.dashLineName"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'line'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.stroke"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'line'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.strokeSide"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'polygon'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.fill"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'polygon'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.borderColor"></i>
                        </td>

                        <td ng-if="search.curDict.type == 'building'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.roofColor"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'building'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.rootColor"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'building'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.wallColor"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'building'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.windowColor"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'building'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.roofLineColor"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'building'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.wallLineColor"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'building'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.roofLineColor2d"></i>
                        </td>
                        <td ng-if="search.curDict.type == 'building'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.roofColor2d"></i>
                        </td>

                        <td ng-if="search.curDict.type == 'arrow'" class="text-center">
                            <i class="glyphicon glyphicon-ok text-success" ng-show="search.curDict.id == item.color"></i>
                        </td>

                        <td>
                            <!--<a href='javascript:void(0)' ng-click='editRule(item)' class='btn btn-xs btn-link'><span
                                class='fa fa-edit'></span>编辑</a>-->
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>